from classTesting1902.unittest_demo import suite_demo

'''
程序主入口, 构建运行的测试用例
'''
import unittest

suite = unittest.TestSuite()
# TestLoader类, 使用时后面要()
# 1.导入模块中的测试用例
test1 = unittest.TestLoader().loadTestsFromModule(suite_demo)
# 2.loadTestsFromTestCase: 把类导入到测试集
test2 = unittest.TestLoader().loadTestsFromTestCase(suite_demo.TestDemo)
# 3. loadTestsFromName, 导入的对象可以模块名, 类名.
test3 = unittest.TestLoader().loadTestsFromName('suite_demo')
test4 = unittest.TestLoader().loadTestsFromName('suite_demo.TestDemo')
# 4. loadTestsFromNames

suite.addTests(test4)
runner = unittest.TextTestRunner(verbosity=2)
runner.run(suite)
